.app-shell {
  min-height: 100vh;
  display: grid;
  align-items: start;
  justify-items: center;
  padding: 16px 16px 92px;
}

.loading-view,
.auth-view {
  width: min(100%, 390px);
  padding: 24px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
}

.loading-view {
  align-self: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
}

.loading-view h1 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.1;
}

.loading-view p {
  margin: 0;
  color: var(--color-muted);
}

.main-view {
  width: min(100%, 720px);
  min-width: 0;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 8;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 8px 0;
  background: var(--color-background);
}

.app-header h1 {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  font-size: 1.15rem;
  line-height: 1.1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab-nav {
  position: fixed;
  right: 12px;
  bottom: 12px;
  left: 12px;
  z-index: 9;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 6px;
  margin: 0 auto;
  max-width: 720px;
  padding: 6px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
}

.tab-nav span {
  display: none;
}

.tab-nav button {
  place-items: center;
  gap: 0;
  padding: 0;
}

.view-section {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.view-header h2 {
  margin: 0;
  font-size: 1.35rem;
}

.view-header p {
  margin: 4px 0 0;
  color: var(--color-muted);
}

.project-group {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.project-group h3 {
  margin: 0;
  font-size: 1rem;
}

.home-compact > .project-group {
  gap: 8px;
}

.section-groups {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.section-groups > .section-group,
.section-groups > #changes-requested-slot {
  width: min(100%, 720px);
  min-width: 0;
}

.section-group {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.section-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.section-group-header h2 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-group-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}

.home-project-groups {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.home-project-groups > .project-group,
.home-project-groups > #changes-requested-slot {
  width: min(100%, 720px);
  min-width: 0;
}

.home-project-groups > #changes-requested-slot {
  justify-self: center;
}

.project-list,
.admin-project-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.admin-projects-header {
  align-items: center;
  gap: 10px;
}

.admin-projects-header > div {
  min-width: 0;
}

.admin-projects-header h2 {
  margin: 0;
}

.admin-projects-view {
  gap: 12px;
}

.admin-projects-view > .status-text {
  margin-top: 0;
}

.admin-section-selector {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.admin-section-selector-button {
  width: 100%;
  display: grid;
  place-items: center;
  padding: 0;
}

.admin-section-selector-button svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  color: currentColor;
}

.admin-section-selector-button.active {
  border-color: var(--color-primary);
  background: var(--color-surface);
  color: var(--color-primary);
}

body:not([data-shell="auth"]) .auth-view h1 {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.1;
}

@media (max-width: 520px) {
  .app-shell {
    padding: 12px 12px 92px;
  }

  .app-header {
    align-items: center;
  }
}

body:not([data-shell="auth"]) .auth-view p {
  margin: 0;
  color: var(--color-muted);
}

body:not([data-shell="auth"]) .auth-view .intro {
  margin-top: 8px;
  line-height: 1.5;
}
